<template>
	<view class="index">
		<view class="swiper-container">
			<!-- 轮播图组件 -->
			<swiper class="swiper-box" autoplay="true" interval="3000" duration="500" circular="true"
				indicator-dots="true">
				<swiper-item v-for="(item, index) in images" :key="index">
					<image :src="item" mode="aspectFill" class="swiper-image"></image>
				</swiper-item>
			</swiper>
		</view>
		<view class="navigation-items">
			<view class="navigation">
				<view class="navigation-box" v-for="(items,index) in 8" :key="index">
					<view class="navigation-box-top iconfont icon-tougao"></view>
					<view class="navigation-box-bottom">
						校园墙投稿
					</view>
				</view>
			</view>
		</view>
		<view class="campus-wall">
			<view class="campus">
				<view class="campus-head">
					<view class="vertical"></view>
					<p class="title">校园墙</p>
				</view>
				<view class="campus-content" v-for="(data,index) in 5" :key="index">
					<p class="p">失物招领：东校区12号男生宿舍楼谁的裤子被风吹掉下来了，自己找楼下宿管阿姨领取。</p>
					<span class="time">2025-02-20 18:02:39</span>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	// 轮播图图片数组
	const images = ref([
		'https://picsum.photos/800/400?random=1',
		'https://picsum.photos/800/400?random=2',
		'https://picsum.photos/800/400?random=3'
	]);
</script>

<style lang="scss">
	.index {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		.swiper-container {
			position: relative;
			width: 100%;
			height: 400rpx;

			.swiper-box {
				width: 100%;
				height: 100%;
			}

			.swiper-image {
				width: 100%;
				height: 100%;
			}
		}

		.navigation-items {
			width: 100%;
			height: 400rpx;
			margin-top: 20rpx;

			.navigation {
				width: 710rpx;
				height: 400rpx;
				margin: 0rpx 20rpx;
				border-radius: 20rpx;
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				background-color: rgb(221, 253, 250);

				.navigation-box {
					width: 140rpx;
					height: 150rpx;
					margin: 0rpx 10rpx;

					.navigation-box-top {
						text-align: center;
						font-size: 60rpx;
						margin-top: 40rpx;
					}

					.navigation-box-bottom {
						text-align: center;
						font-size: 28rpx;
						margin-top: 20rpx;

					}
				}
			}
		}

		.campus-wall {
			width: 100%;
			height: 100vh;
			margin-top: 20rpx;

			.campus {
				width: 710rpx;
				height: 100vh;
				margin: 0rpx 20rpx;
				border-radius: 20rpx;
				background-color: rgb(221, 253, 250);

				.campus-head {
					width: 690rpx;
					margin-left: 20rpx;
					padding-top: 40rpx;
					display: flex;
					align-items: center;

					.vertical {
						width: 15rpx;
						height: 70rpx;
						background-color: rgb(32, 218, 180);
						border-radius: 20rpx;
						margin-right: 20rpx;
					}

					.title {
						text-align: center;
						font-size: 48rpx;
						font-weight: 600;
					}
				}

				.campus-content {
					width: 690rpx;
					margin-left: 20rpx;
					padding-top: 40rpx;

					.p {
						font-weight: 600;
						margin-bottom: 20rpx;
					}

					.time {
						color: rgb(154, 156, 157);
					}
				}
			}
		}
	}
</style>